package org.xwb.springcloud.messagetype.workqueue;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;
import org.xwb.springcloud.constant.MqConstant;

import javax.annotation.Resource;

/**
 * @author 10564
 */
@Component
public class WorkQueueProducer {
    private static final Logger log = LoggerFactory.getLogger(WorkQueueProducer.class);

    @Resource
    private RabbitTemplate rabbitTemplate;

    public void senderWorkQueueMessage(String message) {
        log.info("\n工作队列生产者发送消息:{}\n",message);
        rabbitTemplate.convertAndSend(MqConstant.WORK_QUEUE_NAME,message);
    }
}
